import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/newsList',
    meta:{
      title:'重定向',
    }
  },
  {
    path: '/newsList',
    name: 'newsList',
    component: () => import(/* webpackChunkName: "newsList" */ '../views/newsList.vue'),
    meta:{
      title:'新闻列表'
    }
  },
  {
    path: '/newsType',
    name: 'newsType',
    component: () => import(/* webpackChunkName: "newsType" */ '../views/newsType.vue'),
    meta:{
      title:'新闻分类'
    }
  },
  {
    path: '/users',
    name: 'users',
    component: () => import(/* webpackChunkName: "users" */ '../views/users.vue'),
    meta:{
      title:'用户管理'
    }
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login.vue'),
    meta:{
      title:'登录',
      hidden:true
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
